<script setup lang='ts'>
// import { ref, computed } from 'vue'
import {onMounted, ref} from 'vue'

// const count = ref(100)

// const newCount = computed<string>(() => count.value*2+'1')

// `event` 隐式地标注为 `any` 类型，如何指定：event 类型?
// 1. @change="handleChange($event)"" 查看$event类型
// 2. 鼠标摸一下事件 @change 查看类型

const changeInput = (e:Event) => {
    console.log(e.target as HTMLInputElement);
    console.log('我修改了');
}

const inputDom = ref<HTMLInputElement | null>(null)

onMounted(() => {
    inputDom.value!.focus()
})

const list = ref([1,2,3,4])

list.value.forEach(item => console.log(item))


</script>
<template>
  <div>
    <input type="text" @change="changeInput" ref="inputDom">
  </div>
</template>
<style lang='less'>
 
</style>
